//
// Created by xiaoma on 1/31/21.
//

#ifndef HORSE_VM_BYTECODE_H
#define HORSE_VM_BYTECODE_H

class ByteCode {
public:
    static const unsigned char BINARY_ADD = 23;
    static const unsigned char PRINT_ITEM = 71;
    static const unsigned char PRINT_NEWLINE = 72;
    static const unsigned char BREAK_LOOP = 80;
    static const unsigned char RETURN_VALUE = 83;
    static const unsigned char POP_BLOCK = 87;

    static const unsigned char HAVE_ARGUMENT = 90; // this is a separator

    static const unsigned char STORE_NAME = 90;
    static const unsigned char LOAD_CONST = 100;
    static const unsigned char LOAD_NAME = 101;
    static const unsigned char COMPARE_OP = 107;
    static const unsigned char JUMP_FORWARD = 110;
    static const unsigned char JUMP_ABSOLUTE = 113;
    static const unsigned char POP_JUMP_IF_FALSE = 114;
    static const unsigned char SETUP_LOOP = 120;

    enum COMPAR {
        LESS = 0,
        LESS_EQUAL,
        EQUAL,
        NOT_EQUAL,
        GREATER,
        GREATER_EQUAL
    };
};

#endif //HORSE_VM_BYTECODE_H
